Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BDCMC motion profiling #684

Draft
wants to merge 16 commits into
base: integration
Choose a base branch
from
Draft

BDCMC motion profiling #684

wants to merge 16 commits into from

Conversation

jmaff
Copy link
Contributor

@jmaff jmaff commented Apr 12, 2024

Summary

Closes #(Your issue number here)

What features did you add, bugs did you fix, etc?

Did you add documentation to the wiki?

Yes/No (If not explain why not)

How was this code tested?

Summarize how you tested this code. Your objective here is to prove to the reviewers that this code actually works without them having to run it themselves. It is often helpful to include screenshots, tables, graphs, and/or a short write-up of testing procedures. Results can be either from sim, the robot, or both depending on what you think is sufficient for the feature you added.

Did you test this in sim?

Yes/No

Did you test this on the rover?

Yes/No

Did you add unit tests?

Yes/No (If not explain why not)

@jmaff jmaff linked an issue Apr 12, 2024 that may be closed by this pull request
@jmaff
Copy link
Contributor Author

jmaff commented Apr 12, 2024

Firmware-only (bypassing CAN messages) testing being done in bdcmc-mopro-testing

@qhdwight
Copy link
Collaborator

👀

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these, I think u accidently commited ur cmake-build-debug

#include "units/units.hpp"

namespace mrover {
template<IsUnit PositionUnit = Radians, IsUnit TimeUnit = Seconds>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey at least someone other than me understands how to use the units library! Cool cool

@qhdwight
Copy link
Collaborator

This looks great! Any plans to recompute the trapezoid if there is a big enough delta between current value and setpoint?

@qhdwight qhdwight force-pushed the integration branch 5 times, most recently from 8e721f6 to 65c9dc9 Compare April 19, 2024 04:46
mT += dt;
}

auto velocity() -> VelocityUnit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff dude! Not suggesting you make this change but just for your knowledge: you can actually write code that does this without ever explicitly computing a time schedule for the acceleration changes. The main benefit is that the logic is less cumbersome and the output state is only dependent on the current state meaning you can extend it to use sensor measurements in a "feedback" fashion.

if ( v^2 / (2 * maxAccel) >= setpointPos - actualPos )  {
   // start slowing down at maxAccel
}
if ( v >= vmax ) {
   // stop accelerating
}
// step kinematics
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trapazoidal motion profiling for brushed
3 participants